package com.cje.factory.simplefactory;/**
 * @Auther: ChenJinEn
 * @Date: 2020/8/10 10:49
 * @Description: //TODO
 */

/**
 *@ClassName CarCreatFactory
 *@Description TODO 简单工厂 也称为静态工厂,但是违背了开闭原则
 *@Author checkZH
 *@Date 2020/8/10 10:49
 *@Version 1.0
 */
public class CarCreatFactory {

    public static Car getCar(String name){
        if ("奥迪".equals(name)) {
            return new AudiCar();
        }else if ("宝马".equals(name)){
            return new BaoMaCar();
        }
        return null;
    }
}
